package yunjiao.javatutorials.guava.concurrent.api;

import com.google.common.util.concurrent.RateLimiter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 定义 RateLimiter 配置
 *
 * @author yangyunjiao
 */
@Configuration
public class RateLimiterApiConfig {
    // 全局接口 QPS=20
    @Bean
    public RateLimiter globalRateLimiter() {
        return RateLimiter.create(10.0);
    }
}
